import os
path=os.getcwd()#get the path
for file in os.listdir(path):
  if file.endswith('.jpg'):  #get .jpg file
    new_name='cam_3_'+str(file[0:2])+'.jpg' #rename this file
    os.rename(file,new_name)
    print file
